home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWSelect.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.7 KB  |  152 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWSelect.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSELECT_H
  11. #define FWSELECT_H
  12.  
  13. #ifndef FWPRTDEF_H
  14. #include "FWPrtDef.h"
  15. #endif
  16.  
  17. // ----- Foundation Includes -----
  18.  
  19. #ifndef FWSTDDEF_H
  20. #include "FWStdDef.h"
  21. #endif
  22.  
  23. #ifndef FWRUNTYP_H
  24. #include "FWRunTyp.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class ODStorageUnit;
  38. class ODStorageUnitView;
  39. class ODFacet;
  40. class ODShape;
  41. class ODSession;
  42.  
  43. class FW_CPart;
  44. class FW_CFrame;
  45. class FW_CPresentation;
  46. class FW_CCloneInfo;
  47. class FW_CPromise;
  48. class FW_CPoint;
  49. class FW_CMouseEvent;
  50. class FW_CLinkSource;
  51. class FW_CContent;
  52.  
  53. //========================================================================================
  54. //    constants
  55. //========================================================================================
  56.  
  57. extern const ODPropertyName FW_kPropFrameInfo;             // = "Framework:Property:FrameInfo";
  58.  
  59. //========================================================================================
  60. //    class FW_CSelection
  61. //========================================================================================
  62.  
  63. class FW_CSelection
  64. {
  65. public:
  66.     FW_DECLARE_AUTO(FW_CSelection)
  67.  
  68. //----------------------------------------------------------------------------------------
  69. //    Initialization/Destruction
  70. //
  71. public:
  72.     FW_CSelection(Environment* ev, FW_Boolean allowLinkSource, FW_Boolean allowLink);
  73.     virtual    ~FW_CSelection();
  74.  
  75. //----------------------------------------------------------------------------------------
  76. //    New API
  77. //
  78. public:
  79.     virtual FW_Boolean                IsEmpty(Environment* ev) const = 0;    
  80.     virtual void                    SelectAll(Environment* ev) = 0;
  81.     virtual void                    ClearSelection(Environment* ev) = 0;
  82.     virtual void                    CloseSelection(Environment* ev) = 0;
  83.     virtual FW_CContent*            GetSelectedContent(Environment* ev) = 0;
  84.     
  85.     // ----- Linking -----    
  86.     virtual FW_Boolean                IsSelectionLinkable(Environment* ev);
  87.     virtual FW_Boolean                CanPasteAsLink(Environment* ev, 
  88.                                             ODPasteAsMergeSetting& setting,
  89.                                             ODStorageUnit* su);
  90.  
  91.     virtual FW_CLinkSource*            DoFindLinkSource(Environment* ev);
  92.  
  93.     // ----- Selection region and hit testing -----    
  94.     virtual FW_Boolean                IsMouseInDraggableItem(Environment* ev, 
  95.                                             FW_CFrame* frame,
  96.                                             const FW_CMouseEvent& theMouseEvent, 
  97.                                             FW_Boolean inBackground);                            
  98.     virtual ODShape*                CreateSelectionOutline(Environment* ev, 
  99.                                             ODFacet* facet, 
  100.                                             FW_CFrame* frame) const;
  101.     virtual ODShape*                CreateSelectionShape(Environment* ev, 
  102.                                             ODFacet* facet, 
  103.                                             FW_CFrame* frame) const;
  104.  
  105.     virtual void                    UpdateSelectionOnMouseDown(Environment* ev, 
  106.                                             const FW_CMouseEvent& mouseEvent,
  107.                                             ODFacet* embeddedFacet,
  108.                                             FW_Boolean inEmbeddedFrameBorder,
  109.                                             FW_Boolean inBackground);
  110.                                                 
  111.     // ----- Getters/Setters -----
  112.     FW_CPresentation*                GetPresentation(Environment* ev) const;
  113.     ODSession*                        GetSession(Environment* ev) const;
  114.     FW_CPart*                        GetPart(Environment* ev) const;
  115.  
  116. //----------------------------------------------------------------------------------------
  117. //    For Internal Use Only
  118. //
  119. public:    
  120.     void                            PrivSetPresentation(FW_CPresentation* presentation);
  121.     
  122. //----------------------------------------------------------------------------------------
  123. //    Data Members
  124. //
  125. protected:
  126.     FW_CPresentation*                fPresentation;
  127.     FW_Boolean                        fAllowLinkSource;
  128.     FW_Boolean                        fAllowLink;
  129. };
  130.  
  131. //========================================================================================
  132. //    FW_CSelection Inlines
  133. //========================================================================================
  134.  
  135. //----------------------------------------------------------------------------------------
  136. //    FW_CSelection::GetPresentation
  137. //----------------------------------------------------------------------------------------
  138. inline FW_CPresentation* FW_CSelection::GetPresentation(Environment*) const
  139. {
  140.     return fPresentation;
  141. }
  142.  
  143. //----------------------------------------------------------------------------------------
  144. //    FW_CSelection::PrivSetPresentation
  145. //----------------------------------------------------------------------------------------
  146. inline void FW_CSelection::PrivSetPresentation(FW_CPresentation*  presentation)
  147. {
  148.     fPresentation = presentation;
  149. }
  150.  
  151. #endif
  152.